{% macro table(data, required, table_class="table table-hover") %}
<div class="container mt-4">
    <div class="row">
        <div class="col-md-12">
            <table class="{{ table_class }}">
                <thead>
                    <tr>
                        {% for key, value in required.items() %}
                        <th>{{ value }}</th>
                        {% endfor %}
                    </tr>
                </thead>
                <tbody>
                    {% for row in data %}
                    <tr>
                        {% for key, value in required.items() %}
                        <td>
                            {% if key in row %}
                                {{ row[key] | safe}}
                            {% endif %}
                        </td>
                        {% endfor %}
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endmacro %}